package com.code.softeem.jc;

public class B extends A{
    private int age;
    private String type;

    public B() {
        super();//调用父类的无参构造器
        System.out.println("创建b的对象");
    }

    public B(int id, String name, int age, String type) {
        super(id, name);
        this.age = age;
        this.type = type;
        System.out.println("B有参构造函数");
    }

    public void play(){
        System.out.println("玩游戏");
    }
}
